vue element ui this.$alert 样式修改,长词自动换行、自定义html标签无效果

您所在的位置:网站首页 element 弹窗 vue element ui this.$alert 样式修改,长词自动换行、自定义html标签无效果

vue element ui this.$alert 样式修改,长词自动换行、自定义html标签无效果

2023-12-09 11:04| 来源: 网络整理| 查看: 265

问题1:

vue alert提示框长词无法自动换行(一个连起来的词)

 

解决: 自定义一个class 名

this.$alert(row.content, row.title, { confirmButtonText: '确定', customClass:'message_box_alert' });

CSS:

/**站内信长单词强制换行 */ .message_box_alert { word-break: break-all !important; }

这里要注意下!!!!如果 style 标签后面加了  scoped 会导致样式无效!!!!

 

问题2: 自定义html标签无效果

 解决: dangerouslyUseHTMLString:true,

this.$alert(row.content, row.title, { confirmButtonText: '确定', dangerouslyUseHTMLString:true, customClass:'message_box_alert' });

效果:

 

 

参考

https://blog.csdn.net/qq_35393869/article/details/90780471

 

https://segmentfault.com/q/1010000014867718



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3